public class QuizCheck
{
   /**
      Checks whether a string of quiz answers is valid. It must 
      contain an answer A, B, C, or D for each expected answer, or an 
      X to indicate that no answer was provided.
      @param input the answer string
      @param questions the number of questions in the string
      @return true if the string was valid, false otherwise
   */
   public static boolean checkInputs(String input, int questions)
   {
      char arr[] = input.toCharArray();
      if(arr.length != questions)
      {
         return false;
      }
      for( int i = 0; i < arr.length; i++)
      {
         if(arr[i] != 'A' && arr[i] !='B' && arr[i] != 'C' && arr[i] != 'D' && arr[i] != 'X')
         {
            return false;
         }
      }
      return true;
   }
}